import request from '@/utils/request.js'

export async function getAreaList(city_id) {
	const resp = await request({
		url: "/index/getCityArea",
		data: { city_id },
	})
	let { code, data } = resp
	if (code !== 1) return [{
		labe: '区/县级',
		value: 0
	}]
	if (!data) data = []
	data.unshift({ id: 0, name: '区/县级' })
	return data.map(item => {
		const { id: value, name: label } = item
		return { value, label }
	})
}